StupidBeauty
Read times:484Posted at:Mon May 7 00:50:55 2012
- no title specified

转载:用 PHP 读取文件的正确方法

使用fgets函数可读取一行。

http://www.ibm.com/developerworks/cn/opensource/os-php-readfiles/

亮点:

清单 1. fgets 打开并读取文件

$file_handle = fopen("myfile", "r");

while (!feof($file_handle)) {

$line = fgets($file_handle);

echo $line;

}

fclose($file_handle);

Your opinions
Your name:Email:Website url:Opinion content: